Implementation Notes

Issue #9 — Public API Polish & Examples — 2026-06-14

Design Decisions

RelayAgent uses Arc for shared ownership between run tasks

The run() method spawns one tokio task per interface. Each task holds an Arc clone of the inner state (config, stats). shutdown() uses a tokio watch channel for graceful signal propagation.

RelayStatsSnapshot for serializable metrics

Atomic counters are non-serializable. The snapshot() method returns a plain struct with #[derive(Serialize)] for exporters.

Deviations

run() is dhcpv4-only

The run() method only processes DHCPv4 packets. DHCPv6 relay support in the main loop is deferred. The non-dhcpv4 stub is a placeholder.